package tfts

import "sort"

type Source int

var results []result0
var deferredRun = false

const (
	AttackS Source = iota
	CastS
	PassiveS
	HealS
	ShieldS // 注意技能护盾不参与挨打回蓝
	GrowS
)

type result0 struct {
	taken  int
	output string
}

type record0 struct {
	ticks      int     // 当前事件，单位ms
	Now        int     // 当前的时间，单位秒
	AtkTimes   int     // 攻击次数
	CastTimes  int     // 施法次数
	SpendMana  int     // 总共消耗的法力值
	BeatenMana float64 // 挨打回蓝
	DmgRecord  []int   // 每秒受到的实际生命值伤害
	pureTaken  int     // 总共扣除的血量+护盾
	totalTaken int     // 总共承受的伤害
}

func DeferredOutput() {
	outputLevel = METRIC
	deferredRun = true
}

func AllOut() {
	sort.Slice(results, func(i, j int) bool {
		return results[i].taken > results[j].taken
	})
	for _, res := range results {
		print(res.output)
	}
}
